import * as echarts from "echarts";

/**
 * @param {number} value 待处理数字
 * @param {number} precision 保留小数位
 * @param {boolean} returnStr 是否返回字符串类型
 * @returns {number|string}
 */
export const round = (value, precision = 2, returnStr = false) => {
  const val = value == null ? 0 : value;
  return echarts.number.round(val, precision, returnStr);
};
